Buffering of partition tables, file system directory structures and individual file cluster chains in a mass storage device

ABSTRACT

A computer system for storing data includes a host computer having system RAM associated with the computer system, and a file directory peripheral bus connected to the host computer. A mass memory storage peripheral computer device is connected to said peripheral bus, the mass memory storage peripheral computer device having access to the file directory to locate data on the mass memory storage peripheral computer device.

FIELD OF THE INVENTION

The present invention relates generally to an arrangement of a massmemory storage peripheral computer device and method for operating amass memory storage peripheral computer device, and more particularly toa method and arrangement for operating a mass memory storage peripheralcomputer device such as a hard disk drive connected to a host computerusing a peripheral bus.

Pending U.S. patent application Ser. No. 08/553,024 is incorporated byreference in its entirety.

BACKGROUND OF THE INVENTION

During the development of the personal computer industry, the typicalarrangements for operating a hard disk drive connected to a hostcomputer have gone through a series of evolutions. When the personalcomputer was first developed, it was assumed that hard disk drives wouldbe divided into cylinders, heads, and sectors which would clearly defineeach data sector in which information could be stored on the hard diskdrive. Each of these data sectors could be directly addressed, however,operating systems and application programs needed a higher level methodof addressing data being stored. Application programs work with data inthe form of files. A file typically has a name associated with it, asize, the date it was created, the date it was last modified, etc.

When an application program reads or writes data from one of its files,it manipulates that file as if all of the data associated with that fileis stored together. When an application program needs to open a file itdoes so by specifying the name of the file to the operating system. Theoperating system is responsible for taking the file name request fromthe application program and figuring out what sector or sectors on themass storage device the file data is stored in. Operating systemsperform this function through the use of file systems. A file system isa logical mapping of file names to the physical sectors on a massstorage device that the files data is stored in. The DOS operatingsystem defined one such file system called the FAT 16 file system.

The FAT 16 file system uses a small portion of the physical storagespace of a mass storage device to store the mapping information thatallows the DOS operating system to find where data associated with aparticular file is physically located on the mass storage device.

The FAT 16 file system consists of several parts. When a hard disk driveis initially setup for use within a computer it must first bepartitioned. Part of this partitioning process is to create a MasterBoot Record which divides the disk into one or more distinct areas.Inside the Master Boot Record there are pointers to each of these areas.The pointers typically specify the physical cylinder, head and sectorthat is the first sector for each defined area.

The operating system is responsible for setting up each one of theseareas by defining, creating and storing the file system data that willbe used to manage each particular partition on the disk. The file systemdata is typically created and written to the disk during the formatprocess. During the format process for the FAT 16 file system,additional data is written to the disk. The first is the Boot Record forthe partition. The Boot Record contains information about the filesystem being used in the current partition. For the FAT 16 file systemit contains such information as the number of bytes per sector, thenumber of sectors per cluster, the number of copies of the FAT table,maximum number of root directory entries, the number of sectors used foreach copy of the FAT table, etc. This information is the foundation ofthe file system being used in the current partition. It should beunderstood that there are many different types of file systems and thetypes of data stored in a particular file systems Boot Record couldvary.

The next element stored on the disk for the FAT 16 file system is theFile Allocation Tables (FAT). This table represents a grouping ofsectors into what is called clusters. A Cluster is the minimum amount ofspace that can be allocated to any particular file. Furthermore, if morethan one cluster is required then additional space is allocated onecluster at a time. Clusters are used to allocate space on the disk sothat a pointer does not have to be maintained in a File Allocation Tablelike structure to chain individual sectors of a file together. Clustersmake the management of file data more manageable.

The final element stored on the disk for the FAT 16 file system is theDirectory Structure. The Directory structure is a table of entries thatcontains the files name along with information about when that file wascreated, how big the file is, the name of the file, along with thestarting cluster for the file. The operating system will look throughthe Directory structure for a match on a file name. Once a match isfound, the operating system can look to see what the starting cluster isand therefore where the actual data for the file starts at on the disk.Typically, all of this file system data, Boot Records, Directory Tables,Clusters, etc. are used by the operating system to keep track of readingand writing file data from the disk. Typically these are stored on thedisk itself and the operating system reads and writes this data asnecessary to manage its files stored on the disk.

Additionally, there are many other types of computer systems runningUNIX, NetWare, or one of several other single-user or multi-useroperating systems that have many different types of file systems. Whileeach of these system may store and use different types of data for itsparticular file system, the overall concept is the same. The applicationprograms make requests to open file with a file name. The operatingsystem reads its specific file system data by using the file nameprovided by the application program to look up where that file starts onthe disk. This information is still stored on the disk on a portion ofthe disks storage media, and is read by the operating system as it isneeded in order to operate on files that are stored on that disk.

Referring to FIG. 1, a typical current computer system, generallyindicated by reference numeral 10, includes an IDE hard disk drive, anda hard disk drive connected to the system using a SCSI adapter card anda PCI bus will be described. As shown in FIG. 1, system 10 includes ahost computer module 12 referred to in the specification and claims as ahost computer having system BIOS ROM 13 and system RAM 14. The system isoperated using a system BIOS 15 and a translating BIOS 11 which arestored within system BIOS ROM 13. A host bridge 16 connects the hostcomputer 12 to a ISA bus 17 and a PCI bus 18. A first hard disk drive 19is connected to the ISA bus 17 using ribbon cable 20. Drive 19 includesdisk drive firmware 21 stored on ROM 22 and disk drive controller 23 forcontrolling the operation of disk drive 19. A peripheral device in theform of a SCSI adapter card 24 is connected to the PCI bus 18 andincludes a protocol translator 25 for translating all communicationspassing through the SCSI adapter card 24 between the PCI protocol of thePCI bus and the protocol of the adapter card, in this case SCSIprotocol. Adapter card 24 also includes expansion BIOS ROM 26 whichcontains expansion BIOS for initializing adapter card 24 during thestart-up of the system. System 10 further includes a second hard diskdrive 27 which is connected to adapter card 24. Disk drive 27 includes aRAM memory buffer 28, a disk drive controller 29, and disk drivefirmware 30 stored within ROM 31 for controlling the operation of thehard disk drive 27. Hard disk drive 27 is electrically connected toadapter card 24 using ribbon cable 32. Both hard disk drives 19 and 27are divided into cylinder, head sectors, and zones which preferablydefine each data sector within the hard disk drives 19 and 27.

The disk drive typically includes file system data, such as cluster data104, and a directory data 106 so that the location of files can beaccessed on the disk. The directory 106 translates the file name to astarting cluster 104. The cluster 104 translates the cluster 104 to asector 102 where the actual file data is located.

SUMMARY OF THE INVENTION

The present invention provides an arrangement for the method ofoperating a mass memory storage peripheral computer device and a systemincluding a mass memory storage peripheral computer device where thefile system data is cached and used out of host computer RAM instead offrom the mass memory storage peripheral computer device.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a system;

FIG. 2 illustrates a system of the present invention;

FIG. 3 illustrates the relationship between the directory clusters andsectors;

FIG. 4 illustrates a boot record;

FIG. 5 illustrates the relationship between the records associated withone physical drive;

FIG. 6 illustrates the directory entries;

FIG. 7 illustrates a 12-bit FAT layout;

FIG. 8 illustrates a 16-bit FAT layout;

FIG. 9 illustrates a disk partition table layout;

FIG. 10 illustrates details for a read cache;

FIG. 11 illustrates a disk boot record layout; and

FIG. 12 illustrates a hard disk format summary.

DETAILED DESCRIPTION OF THE PRESENT INVENTION

Referring to FIG. 2, a computer system designed in accordance with thepresent invention and designated generally by reference numeral 46 isdescribed. Computer system 46 includes a host computer 48, system RAM50, a peripheral bus 52, such as a PCI bus, a host bridge 54 connectingperipheral bus 52 to host computer 48 and system RAM 50 and a massmemory storage peripheral computer device 56 having a mass memorystorage 58. Mass memory storage device 56 is connected to the hostcomputer 48 using a peripheral bus 52. Host computer 48, system RAM 50,and host bridge 54 are made up of components which allow host computer48 and RAM 50 to be connected to the peripheral bus 52 using host bridge54. These components include but are not limited to a conventional 486,Pentium®, Power PC® or RISC-based components. Although host computer 48,system RAM 50, and host bridge 52 are shown having a particularconfiguration relative to one another, it should be understood that thisis not a requirement of the present invention. Instead, these componentsmay be interconnected in a variety of specific configurations and stillremain within the scope of the invention so long as the mass memorystorage peripheral computer device 56 is connected to these componentsusing peripheral bus 52 as described hereinafter.

Peripheral bus 52 may be any suitable and readily providable peripheralbus. One possible peripheral bus is a PCI bus. However, it should beunderstood that a wide variety of peripheral buses, such as otherparallel buses, serial buses, or multiplexed buses would also fallwithin the scope of the present invention.

Referring to FIG. 2, mass memory storage peripheral computer device 56is a hard disk drive, and memory storage 58 is the hard disk drivememory storage. The hard disk drive memory storage 58 of hard disk drive56 is divided into conventional heads, cylinders, sectors, and zoneswhich define the specific location within the memory storage 58 of eachdata storage location. Hard disk drive 56 includes a disk drivecontroller 72 and disk drive firmware 74 to control its operation.

Now that the basic configuration of system 46 has been described, theoperation in connection with FIG. 2 will be described briefly for agiven period of time when an application program 76 being run on thesystem makes a read/write request of the hard disk drive. Whenapplication 76 makes a read/write request using a file name, operatingsystem 64 receives the request and determines the theoretical or logicaldata address at which the operating system 64 believes the data isstored within a partition on disk drive 56 in the same way asconventional systems. However, in accordance with the present invention,the caching mechanism 210 of loadable device driver 66 manages thestorage, lookup and updating of the file system information directly outof system RAM 50.

Normally when an operating system receives a request to read a portionof a file, it must first determine where that file is located on thedisk before it can even try to read the file. This is done by theoperating system reading through the file names in a directory to try tofind a match for the file name that had been requested. This istypically done by the operating system issuing a request to a disk driveto read one or more sectors of directory information directly from thedrive. Once this data has been read from the drive, it can then besearched by the operating system for the file name that it is lookingfor. If the file name is not found then more sectors from the directoryare read into memory by the operating system and then those directoryentries are searched. Once the file has been found in the directory, theoperating system reads the rest of that directory entry to determinewhat cluster the file starts at. If the information being read from thefile is within this first cluster, then the operating system candetermine by what cluster number it found in the directory entry, whatsector it needs to start reading at to read the data from the file.However, if the data being read is not in the first cluster of sectors,then the operating system will have to read the cluster entry from theFAT table to determine where the next cluster is for this particularfile. This continues until the cluster is found that contains the databeing read and then the actual data can be read from the disk.

As can be seen from the above the disk must be read potentially manytimes by the operating system just to determine where to actually readthe data that had been requested in the first place by the applicationprogram. Each of these I/O accesses to the disk takes time and slowsdown the overall performance of the system. These I/O accesses aretaking place over some form if peripheral bus to the system, which todaythese busses operate much slower then the computers processor andmemory. In addition the speed of reading and writing from/to a disk isalso much slower than the computers processor and memory. The presentinvention eliminates the need to perform these I/O access and reads andwrites from/to the disk during the requesting of data from anapplication program.

The loadable device driver 66 uses its internal caching mechanism 210 tofind and supply the relevant file system data that is being requested bythe operating system. The directory and cluster information is providedto the operating system essentially at the speed of memory. Thiseliminates potentially many reads from the disk in order just to startreading actual file data from the disk. The loadable device driver 66 isprovided the file system data from its caching mechanism 210 byaccessing file system, such as directory information 206, clusterinformation 204, directly from the memory in system RAM 50.

The present invention uses a caching mechanism 210 located on the hostcomputer 46 advantageously because the host computer has knowledge ofthe other host activities. More particularly, the caching mechanism 210has information of file directory structure, boot records, etc., andessential logical structure. Because caching mechanism 210 is part ofloadable device driver 66, it was written for a particular operatingsystem. It is known at the time that the loadable device driver 66 iswritten what file systems are supported by the operating system that itwas designed for. This helps in being able to provide the supportnecessary within the caching algorithm to provide caching of the filesystem data because the number of file system that have to be supportedis a known quantity. The caching mechanism 210 can also have knowledgeabout the internal details of each of the file systems that it supports,such as being able to find the individual partitions and understand theparticular details of each of the different types of file systems thatcould be used by a particular operating system. Since the operatingsystem puts a logical layer on the physical layout of the disk drive,how data is arranged and managed by that operating system is operatingsystem specific. Thus a disk drive by itself does not know what type ofpartitioning, or file systems are being stored on it.

The present invention advantageously uses partitioning in connectionwith the lists of logical drives on a physical device. Thus, there aremany or a plurality of partitions for a plurality of logical drives. Forexample, in a typical window operating system, there exists a C drive, aD drive, an E drive, and an F drive which are all connected to aphysical device.

In each partition is additional information on how that partition isbeing used. For example, it contains information about additional bootrecords and additional information concerning file allocation tables. Itmay include information concerning groups, physical sectors, which aregrouped into clusters.

A cluster is a logical group of physical sectors on the drive. There isa single entry in the FAT table for every cluster. Space is allocatedone cluster at a time. Additionally, typically a second copy of the FATfile is kept but not used.

The directory structure points to the first entry in the File AllocationTable (FAT) to where the file begins on the disk drive.

Directory structures include such information as the file name, which isthe name that the operating system has given the file. Thus, it ispossible to add this address to the beginning of the logical partitionto determine where the file is physically on a drive. When a file isupdated, this information is subsequently updated. Before data isactually read from the disk, the location of the data must bedetermined. The cache of the system, for example the FAT table, thedirectory structure, and the boot records, maintain the prior logicallayout of the drive for the cache within the caching algorithm.

With the present invention, it is no longer necessary to go to the driveto determine the location of the data to be written or read from thedisk. It is only necessary for the loadable device driver 66 to accessor query the caching mechanism 210 in order to determine thisinformation. Correspondingly, in operation, the system receives arequest to read or write data from the disk. The file directory is foundthat corresponds to the request by reading it from the caching mechanism210 which maintains that data in host RAM. Next, the cluster is foundthat corresponds to the file directory, and normally a request is sentto the drive to request data from the FAT table, and that information isread from the disk.

The advantage of the present invention is that it speeds up access tothe data. FIG. 3 illustrates the relationship between directory 300,cluster 320, and sector 330. Directory 300 includes, among other things,first directory 302 which includes name, date, and a pointer to firstcluster 322. Additionally, directory 300 includes the name of a seconddirectory 304, the date it was created, and the first cluster of thesecond file. The first directory 302 points to first cluster 322. Thefirst cluster 322 points to the fifth cluster 330 since the secondcluster 324, the third cluster 326, and the fourth cluster 328 havealready been allocated. Thus, the fifth cluster 330 is the next clusteravailable. The second directory 304 includes a pointer to the firstcluster of this file, which is the second cluster 324. The cluster 324in turn points to third cluster 326. Likewise, additional directorieswithin directory 300 would point to the remaining clusters. The cluster320 points to various groups of sectors 340. In this example, firstcluster 322 points to the first four sectors, namely 342 to 348, whichincludes sectors 344 and 346. In a similar fashion, cluster 324 pointsto sectors 350 to 356, which includes sectors 352 and 354. The thirdcluster 326 points to sectors 358 to 364, which includes sectors 360 and362.

FIG. 4 illustrates DOS partition, which includes a master boot record402 and a DOS boot record 404.

FIG. 5 illustrates one potential partitioning of a disk for a DOS systemin conjunction with FIG. 4. One physical drive includes a master bootrecord 514, such as illustrated in FIG. 4, the boot record 512, such asillustrated in FIG. 4, a primary DOS partition 510 to point to theprimary partition and first extended volume, an extended boot record508, an extended volume 506, an extended boot record 504, and anextended volume 502. Each of the Boot records and associated volumesrepresent and contain file system specific information about theparticular file system being used in each of the partitions.

FIG. 6 illustrates an example of directory entries that conceivablycould be located within directory 300. The directory 600 includes a filename 602, which is the name of the file, a file type 604, whichindicates the type of file, a file attribute byte 606, which is aspecial indicator of the type of directory entry, a time file lastupdated 608, which is the time that the file was last updated, a datefile last updated 610, which is the date that the file was last updated,a starting cluster number 612, which is the entry in the cluster table320, and a file size 614, which is an indication of the size of thefile.

FIG. 7 illustrates a 12-bit FAT layout. This FAT table is the clusters320. The FAT layout includes a disk ID byte 702 which is reserved forthe operating systems use and a cluster value 704 to provide someinformation with respect to the cluster, for example, if the cluster isunused, the next cluster number, if the cluster is marked bad, and if itis the last cluster in the file.

FIG. 8 illustrates a 16-bit FAT layout, which is similar to the 12-bitFAT layout, including a disk ID byte 802 and a cluster value 804.

FIG. 9 illustrates a disk partition table layout. The partition status902 provides an indication if the partition is inactive, bootable, oractive. The starting head 904 indicates the logical head the partitionstarts on. The starting cylinder and sector 906 indicates the address ofthe starting position of the sector and cylinder. The partition type 908indicates the type of partition (12-bit FAT, 16-bit FAT, etc.). Theending head 910 is the logical head that the partition ends on. Theending sector and cylinder 912 is the address of the last sector andcylinder. The starting absolute sector 912 is the physical LBA that thepartition starts at. The number of sectors 916 is the number of sectorsin the partition.

As illustrated in FIG. 10, the caching mechanism manages a portion ofhost memory for caching file system data. One particular way that thisdata can be managed by the caching mechanism is for it to use some ofthe space from its read cache host RAM. However, the cached file systemdata could also be stored either in a portion of the caching mechanismswrite cache buffer host RAM or in an entirely separate area of host RAMcould be used to cache the file system data. Where the file system datais cached in host RAM does not matter, so long as the caching mechanismhas read and write access to that host RAM memory. In this case, we aregoing to describe the use of the read cache RAM to cache the file systemdata. In this example, the read cache buffer space includes an area forstoring file system data. This includes a master boot record 1002. Theread cache buffer space includes boot records 1004. The read cachebuffer space also includes file system pointer (FST) 1006 to point tothe clusters 320. Additionally, the read cache buffer space includesdirectory table pointer 1008 to point to the directory table 300. Thedirectory tables 1010 are those found in directories 300.

FIG. 11 illustrates a disk boot record layout. The JMP to boot code 1102provides a displacement to the boot code. The OEM name and version 1104is the name of the computer company or operating system company. Thedisk boot record layout includes bytes per sector 1106 which is thenumber of bytes per sector, sectors per cluster 1108 which is the numberof sectors per cluster, reserved sectors 1110, number of copies of FAT1112, maximum number of root directory entries 1114, total number ofsectors in logical image 1116, media descriptor byte 1118 which is anidentification byte, number of sectors in FAT 1120, and number ofsectors per track 1122. Additionally, the disk boot record layoutincludes number of heads 1124 and number of hidden sectors 1126.

FIG. 12 illustrates the hard disk format summary. The hard disk formatsummary includes disk size 1202, disk ID byte (in FAT) 1204, interleaveinformation 1206, heads per disk 1208, cylinders 1210 which is thenumber of logical cylinders in this partition, sectors per track 1212,bytes per sector 1214, sectors per cluster 1216, number of reservedsectors 1218, number of sectors per FAT 1220, number of FATs per disk1222, number of root directory sectors 1224, maximum number of rootdirectory entries allowed 1226, total number of sectors on disk 1228,total number of usable sectors on disk 1230, total number of usableclusters on disk 1232, capacity of disk in kilobytes 1234, and theformat introduced with the DOS version 1236 to provide some level ofversion information.

By caching the file system data using the caching mechanism 210 ofloadable device driver 66 the overall performance of the computer systemis improved due to less I/O being required to satisfy a file read orwrite request from an application program. Furthermore, having the filesystem caching mechanism integral with the normal read and write datacaching mechanisms of the loadable device driver 66 provides streamlinedcaching out of host RAM for all disk data being cached. This helps toreduce the cost of the mass storage peripheral device by reducing theamount of RAM that is necessary to be put on the mass storage peripheraldevice while at the same time utilizing the fastest possible storagemedium within the computer system, host RAM, to store the cached data.System performance can be greatly improved with a decrease in overallcost.

What is claimed is:
 1. A computer system for storing data, comprising: ahost computer having system RAM associated with said computer system,and a file directory having location data to locate data on a massmemory storage peripheral computer device; a peripheral bus connected tosaid host computer; and said mass memory storage peripheral computerdevice connected to said peripheral bus; wherein said mass memorystorage peripheral computer device accesses said file directory andobtains said location data to locate data on said mass memory storageperipheral computer device.
 2. A computer system for storing data, as inclaim 1, wherein said file directory includes clusters.
 3. A computersystem for storing data, as in claim 1, wherein said file directoryincludes sectors.
 4. A computer system for storing data, as in claim 1,wherein said peripheral bus is a PCI bus.